package com.example.teesystem.entity.vo.boatGame;

import com.example.teesystem.common.cache.UserCache;
import com.example.teesystem.entity.Boat;
import com.example.teesystem.entity.BoatRank;
import com.example.teesystem.entityDto.UserPlayer;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

/**
 * @author pxr
 * @data 26/11/2022 下午3:08
 */
@Data
@NoArgsConstructor
public class BoatRankResponse {
    private Integer uid;
    private Integer score;
    private Integer winNum;
    private UserPlayer userPlayer;

    public BoatRankResponse(BoatRank boatRank){
        BeanUtils.copyProperties(boatRank,this);
        this.userPlayer = new UserPlayer(UserCache.userMap.get(this.uid));
    }
}
